package com.hosever.utils;

import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

/**
 * 我们的爱
 * @author 呵Sever
 *
 */

public class OurLove {
	public static SimpleDateFormat sdf = new SimpleDateFormat("yyyy年MM月dd日");
	
	public static void main(String[] args) {
		Person you = new Person();
		Person me= new Person();
		System.out.println("有两个人");
		me.setName("世华");
		you.setName("肥瑶");
		OurLove ol = new OurLove(me,you);
		System.out.println("我们在"+sdf.format(ol.getLoveTime())+"相爱");
		long fallInLoveDays = (new Date().getTime()-ol.getLoveTime().getTime())/(1000*60*60*24);
		System.out.println("我们生活在一起了"+fallInLoveDays+"天");
		try {
			ol.live();
		} catch (RichPoorHealthDisease e) {
			System.out.println("无论富裕，贫穷，健康，疾病");
		}
		System.out.println("依然不离不弃");
		System.out.println("如果要让这段爱情定终止一个时间");
		System.out.println("我希望是"+ol.setEndTime());
	}
	
	OurLove(Person one,Person anotherOne){
		one.getName();
		anotherOne.getName();
	}
	
	public void live() throws RichPoorHealthDisease{
		throw new RichPoorHealthDisease();
	}
	
	public Date getLoveTime(){
		Calendar cal = Calendar.getInstance();
		cal.set(Calendar.YEAR, 2014);
		cal.set(Calendar.MONTH, 6);
		cal.set(Calendar.DAY_OF_MONTH, 5);
		return cal.getTime();
	}
	
	public String setEndTime(){
		return "我逝世的那天";
	}
}


class Person{
	private String name;
	private Date deathTime;

	public Date getDeathTime() {
		deathTime = null;
		return deathTime;
	}

	public void setDeathTime(Date deathTime) {
		this.deathTime = deathTime;
	}

	public String getName() {
		System.out.println("一个名字叫做 "+name);
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}
}

class RichPoorHealthDisease extends Exception{
	private static final long serialVersionUID = 1L;
}

